package com.goodving.guli.utility;

import android.annotation.SuppressLint;

import java.security.MessageDigest;

/**
 * Created by Administrator on 2015/11/17 0017.
 */
@SuppressLint({"DefaultLocale"})
/* renamed from: cn.ledongli.ldl.utils.n */
public class C1473n {
    public static String m12019a(String str) {
        try {
            byte[] digest = MessageDigest.getInstance("MD5").digest(str.getBytes("UTF-8"));
            StringBuilder stringBuilder = new StringBuilder(digest.length * 2);
            for (byte b : digest) {
                if ((b & C0640l.f1907a) < 16) {
                    stringBuilder.append(Constants.VIA_RESULT_SUCCESS);
                }
                stringBuilder.append(Integer.toHexString(b & C0640l.f1907a));
            }
            return stringBuilder.toString().toLowerCase();
        } catch (Throwable e) {
            throw new RuntimeException("Huh, MD5 should be supported?", e);
        }
//        } catch (Throwable e2) {
//            throw new RuntimeException("Huh, UTF-8 should be supported?", e2);
//        }
    }

    public static String m12020a(byte[] bArr) {
        try {
            byte[] digest = MessageDigest.getInstance("MD5").digest(bArr);
            StringBuilder stringBuilder = new StringBuilder(digest.length * 2);
            for (byte b : digest) {
                if ((b & C0640l.f1907a) < 16) {
                    stringBuilder.append(Constants.VIA_RESULT_SUCCESS);
                }
                stringBuilder.append(Integer.toHexString(b & C0640l.f1907a));
            }
            return stringBuilder.toString().toLowerCase();
        } catch (Throwable e) {
            throw new RuntimeException("Huh, MD5 should be supported?", e);
        }
    }
}
